Release 10.1A: OpenEdge Data Management:
SQL Reference
GET DIAGNOSTICS
Retrieves information about the execution of the previous SQL statement from the SQL diagnostics area. The diagnostics area is a data structure that contains information about the execution status of the most recent SQL statement. Specifically,
Note: TheGET DIAGNOSTICSextracts information about the SQL statement as a whole from the SQL diagnostics area’s header component.GET DIAGNOSTICS EXCEPTIONnumber extracts detail information.Syntax
:paramA host-language variable to receive the information returned by the
GETDIAGNOSTICSstatement. The host-language program must declare a param compatible with the SQL data type of the information item.header_info_itemOne of the following keywords, which returns associated information about the diagnostics area or the SQL statement:
NUMBERThe number of detail areas in the diagnostics area. Currently,
NUMBERis always 1.NUMBERis typeNUMERICwith a scale of 0.MOREA one-character string with a value of Y (all conditions are detailed in the diagnostics area) or N (all conditions are not detailed) that tells whether the diagnostics area contains information on all the conditions resulting from the statement.
COMMAND_FUNCTIONContains the character-string code for the statement (as specified in the SQL standard), if the statements is a static SQL statement. If the statement is a dynamic statement, contains the character string
EXECUTEorEXECUTEIMMEDIATE.DYNAMIC_FUNCTIONContains the character-string code for the statement (as specified in the SQL standard). For dynamic SQL statements only (as indicated by
EXECUTEorEXECUTEIMMEDIATEin theCOMMAND_FUNCTIONitem).ROW_COUNTThe number of rows affected by the SQL statement.
ExampleThe
GET DIAGNOSTICSexample extracts header information about the last SQL statement executed. The information is assigned to host variables that are defined in theDECLARE SECTIONof an embedded SQL program, as shown in the following example:
Note: The
GET DIAGNOSTICSstatement itself does not affect the contents of the diagnostics area. This means applications can issue multipleGET DIAGNOSTICSstatements to retrieve different items of information about the same SQL statement.Related statements
GET DIAGNOSTICS EXCEPTION, WHENEVER
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |